home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / dos / isfilesystem.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  91 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: isfilesystem.c,v 1.2 1996/10/24 15:50:31 aros Exp $
  4.     $Log: isfilesystem.c,v $
  5.     Revision 1.2  1996/10/24 15:50:31  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.1  1996/09/11 12:54:46  digulla
  9.     A couple of new DOS functions from M. Fleischer
  10.  
  11.     Desc:
  12.     Lang: english
  13. */
  14. #include <clib/exec_protos.h>
  15. #include <dos/dosextens.h>
  16. #include <dos/filesystem.h>
  17. #include "dos_intern.h"
  18.  
  19. /*****************************************************************************
  20.  
  21.     NAME */
  22.     #include <clib/dos_protos.h>
  23.  
  24.     AROS_LH1(BOOL, IsFileSystem,
  25.  
  26. /*  SYNOPSIS */
  27.     AROS_LHA(STRPTR, devicename, D1),
  28.  
  29. /*  LOCATION */
  30.     struct DosLibrary *, DOSBase, 118, Dos)
  31.  
  32. /*  FUNCTION
  33.  
  34.     INPUTS
  35.  
  36.     RESULT
  37.  
  38.     NOTES
  39.  
  40.     EXAMPLE
  41.  
  42.     BUGS
  43.  
  44.     SEE ALSO
  45.  
  46.     INTERNALS
  47.  
  48.     HISTORY
  49.     29-10-95    digulla automatically created from
  50.                 dos_lib.fd and clib/dos_protos.h
  51.  
  52. *****************************************************************************/
  53. {
  54.     AROS_LIBFUNC_INIT
  55.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  56.  
  57.     /* Get pointer to process structure */
  58.     struct Process *me=(struct Process *)FindTask(NULL);
  59.     struct DosList *dl;
  60.     BOOL success=0;
  61.  
  62.     dl=LockDosList(LDF_DEVICES|LDF_READ);
  63.     dl=FindDosEntry(dl,devicename,LDF_DEVICES);
  64.     if(dl!=NULL)
  65.     {
  66.  
  67.         /* Get pointer to I/O request. Use stackspace for now. */
  68.         struct IOFileSys io,*iofs=&io;
  69.  
  70.         /* Prepare I/O request. */
  71.         iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  72.         iofs->IOFS.io_Message.mn_ReplyPort   =&me->pr_MsgPort;
  73.         iofs->IOFS.io_Message.mn_Length      =sizeof(struct IOFileSys);
  74.         iofs->IOFS.io_Device =dl->dol_Device;
  75.         iofs->IOFS.io_Unit   =dl->dol_Unit;
  76.         iofs->IOFS.io_Command=FSA_IS_FILESYSTEM;
  77.         iofs->IOFS.io_Flags  =0;
  78.  
  79.         /* Send the request. */
  80.         DoIO(&iofs->IOFS);
  81.         
  82.         /* Set return code */
  83.         if(!iofs->io_DosError)
  84.             success=iofs->io_Args[0];
  85.     }
  86.     /* All Done. */
  87.     UnLockDosList(LDF_DEVICES|LDF_READ);
  88.     return success;
  89.     AROS_LIBFUNC_EXIT
  90. } /* IsFilesystem */
  91.